#ifndef __ECHOSERVER_H_
#define __ECHOSERVER_H_

#include "ThreadPool.hpp"
#include "TcpServer.hpp"

using namespace ln;

class EchoServer{
public:
    EchoServer(unsigned short,const string &,int,int);
    void start();
    void stop();
    void onConnection(TcpConnectionPtr);
    void onMessage(TcpConnectionPtr);
    void onClose(TcpConnectionPtr);

private:
    ThreadPool _threadpool;
    TcpServer  _tcpServer;
};

#endif

